package com.akoj.anmu.controller;

import com.akoj.anmu.common.BaseResponse;
import com.akoj.anmu.common.ResultUtils;
import com.akoj.anmu.service.TagsService;
import com.akoj.model.domain.vo.TagsVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController("/tags")
@Api(tags = "标签模块")
@CrossOrigin(origins = "http://localhost:5173", allowCredentials = "true")
public class TagsController {

    @Resource
    private TagsService tagsService;


    @ApiOperation(value = "获取父级及对应的子级标签")
    @PostMapping(value = "/listTags")
    public BaseResponse<List<TagsVO>> listTags() {
        return ResultUtils.success(tagsService.listTags());
    }

}
